/*************************************************************************
	> File Name: getpwent.c
	> Author: Angel Criss
	> Mail: abbytsing@gmail.com 
	> Created Time: Sun Jul 27 10:50:22 2014
 ************************************************************************/

#include<stdlib.h>
#include<errno.h>
#include<stdio.h>
#include<sys/types.h>
#include<pwd.h>

int main(int argc,char *argv[])
{
    errno=0;
    struct passwd *pwd;

    while((pwd=getpwent())!=NULL)
    {
        if(errno==0)
            printf("%-30s %6ld\n",pwd->pw_name,(long) pwd->pw_uid);
    }

    endpwent();
    exit(0);
}
